<!-- this partial requires collection; @challenges_count, @works_count, @bookmarks_count must be set -->
<li class="<% if collection.user_is_owner?(current_user) %>own<% end %> collection picture blurb">
  <% cache("collection-blurb-#{collection.id}") do %>
 		<div class="header module">
			<h4 title="name">
			<%= link_to collection.title, collection_path(collection) %>
				<span>(<%= collection.name %>)</span>
					<%= ts('by') %>
					<%= collection.all_owners.map {|owner| link_to(owner.byline, owner.user)}.join(", ").html_safe %>
			</h4>
			<!--collections header iconised header image-->
      <div class="icon">
        <%= image_tag(collection.icon.url(:standard), :size => "100x100", :alt => "icon for #{collection.name}", :class => "icon") %>
      </div>
			<p class="datetime"><!--collection updated at--></p>
	    <% if collection.all_moderators.length > 0%>
			  <h6 class="landmark">Mods</h6>
			  <ul title="moderated by" class="mods">
			    <%= collection.all_moderators.map {|mod| content_tag(:li, link_to(mod.byline, mod.user))}.join(", ").html_safe %>
			  </ul>
	    <% end %>
		</div>

    <!--summary/descriptions-->
    <h6 class="landmark">Summary</h6>
    <blockquote class="userstuff summary">
      <%=raw strip_images(sanitize_field(collection, :description)) || "&nbsp;".html_safe %>
      
      <% if collection.challenge && collection.challenge.signup_open %>
        <p><%= ts("Signups close at:") %> <%= time_in_zone(collection.challenge.signups_close_at, (collection.challenge.time_zone || Time.zone.name)) %></p>
      <% end %>
    </blockquote>

    <p class="type">
    (<%= collection.closed? ? t('.collections_index.is_closed', :default => "Closed") : t('.collections_index.open', :default => "Open") %>, <%= collection.moderated? ? t('.collections_index.is_moderated', :default => "Moderated") : t('.collections_index.unmoderated', :default => "Unmoderated") %><%= collection.unrevealed? ? t('.collections_index.is_unrevealed', :default => ", Unrevealed") : "" %><%= collection.anonymous? ? t('.collections_index.is_anonymous', :default => ", Anonymous") : "" %><%= collection.challenge ? t('.collections_index.is_challenge', :default => ", Challenge") : "" %>)
    </p>
    
	  <!--stats-->
		<dl class="stats" title="stats">
      <% if (@challenges_count = collection.children.count) > 0 %>
        <dt><%= ts("Challenges/Subcollections") %></dt>
        <dd><%= link_to(@challenges_count, collection_collections_path(collection)) %></dd>
      <% end %>
			<% if (@works_count = collection.all_approved_works_count) > 0 %>
			  <dt><%= ts("Fandoms") %></dt>
    		<dd><%= link_to(collection.all_fandoms_count, collection_fandoms_path(collection)) %></dd>
    	<% end %>
		  <dt><%= ts("Works") %></dt>
  		<dd><%= link_to(@works_count, collection_works_path(collection)) %></dd>
			<% if (@bookmarks_count = collection.all_approved_bookmarks_count) > 0 %>
     	  <dt><%= ts("Bookmarks") %></dt>
	      <dd><%= link_to(@bookmarks_count, collection_bookmarks_path(collection)) %></dd>
			<% end %>
	  </dl>
  
  <% end %><!-- end cache -->  
  
  <% if collection.user_is_owner?(current_user) || (collection.challenge && collection.challenge.signup_open && logged_in?) %>
    <h6 class="landmark">User Actions</h6>
	  <ul class="navigation" role="navigation">
      <% if collection.user_is_owner?(current_user) %>
        <li><%= link_to 'Edit', edit_collection_path(collection) %></li>
      <% end %>
      <% if collection.challenge && collection.challenge.signup_open && logged_in? %>
        <%= render :partial => "challenge/#{challenge_class_name(collection)}/challenge_navigation_user", :locals => {:collection => collection} %>
      <% end %>
    </ul>
  <% end %>
</li>
<!--end single blurb-->

